-- GENERATED SPELL FOR [Time-Lost Skettis High Priest] --


function spell0_21787(pUnit, Event) --@Flash Heal,Heal--
pUnit:FullCastSpellOnTarget(42420,pUnit)
pUnit:RegisterEvent('Sorts_21787', 1500, 1)
end

function spell1_21787(pUnit, Event) --@Holy Smite,n/a--
pUnit:FullCastSpellOnTarget(9734,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21787', 2500, 1)
end

function spell2_21787(pUnit, Event) --@Shadow Word: Pain,n/a--
pUnit:FullCastSpellOnTarget(11639,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21787', 18000, 1)
end

function spell3_21787(pUnit, Event) --@Shadowform,Self--
pUnit:FullCastSpellOnTarget(16592,pUnit)
pUnit:RegisterEvent('Sorts_21787', 604, 1)
end

function spell4_21787(pUnit, Event) --@Shadowform,Self--
pUnit:FullCastSpellOnTarget(41912,pUnit)
pUnit:RegisterEvent('Sorts_21787', 654, 1)
end

function Sorts_21787(pUnit, Event)
local choix_sorts_21787 = math.random(0, 4)
if choix_sorts_21787 == 0 then
pUnit:RegisterEvent('spell0_21787', 1, 1)
end
if choix_sorts_21787 == 1 then
pUnit:RegisterEvent('spell1_21787', 1, 1)
end
if choix_sorts_21787 == 2 then
pUnit:RegisterEvent('spell2_21787', 1, 1)
end
if choix_sorts_21787 == 3 then
pUnit:RegisterEvent('spell3_21787', 1, 1)
end
if choix_sorts_21787 == 4 then
pUnit:RegisterEvent('spell4_21787', 1, 1)
end
end

function mob21787_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21787', math.random(1500, 3000), 1)
end

function mob21787_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21787_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21787_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21787, 1, 'mob21787_Action')
RegisterUnitEvent(21787, 2, 'mob21787_Leave')
RegisterUnitEvent(21787, 3, 'mob21787_Kill')
RegisterUnitEvent(21787, 4, 'mob21787_Die')
